3.13.7 \(\int \frac {(c+d \tan (e+f x))^3}{(a+b \tan (e+f x))^2} \, dx\) [1207]

Optimal. Leaf size=230 \[ -\frac {\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}+\frac {(b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )^2 f}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))} \]

[Out]

-(b^2*c*(c^2-3*d^2)-2*a*b*d*(3*c^2-d^2)-a^2*(c^3-3*c*d^2))*x/(a^2+b^2)^2+(2*a*b*c*(c^2-3*d^2)+b^2*d*(3*c^2-d^2
)-a^2*(3*c^2*d-d^3))*ln(cos(f*x+e))/(a^2+b^2)^2/f+(-a*d+b*c)^2*(a^2*d+2*a*b*c+3*b^2*d)*ln(a+b*tan(f*x+e))/b^2/
(a^2+b^2)^2/f-(-a*d+b*c)^2*(c+d*tan(f*x+e))/b/(a^2+b^2)/f/(a+b*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.24, antiderivative size = 230, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3646, 3707, 3698, 31, 3556} \begin {gather*} \frac {\left (-\left (a^2 \left (3 c^2 d-d^3\right )\right )+2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )\right ) \log (\cos (e+f x))}{f \left (a^2+b^2\right )^2}-\frac {x \left (-\left (a^2 \left (c^3-3 c d^2\right )\right )-2 a b d \left (3 c^2-d^2\right )+b^2 c \left (c^2-3 d^2\right )\right )}{\left (a^2+b^2\right )^2}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\left (a^2 d+2 a b c+3 b^2 d\right ) (b c-a d)^2 \log (a+b \tan (e+f x))}{b^2 f \left (a^2+b^2\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*Tan[e + f*x])^3/(a + b*Tan[e + f*x])^2,x]

[Out]

-(((b^2*c*(c^2 - 3*d^2) - 2*a*b*d*(3*c^2 - d^2) - a^2*(c^3 - 3*c*d^2))*x)/(a^2 + b^2)^2) + ((2*a*b*c*(c^2 - 3*
d^2) + b^2*d*(3*c^2 - d^2) - a^2*(3*c^2*d - d^3))*Log[Cos[e + f*x]])/((a^2 + b^2)^2*f) + ((b*c - a*d)^2*(2*a*b
*c + a^2*d + 3*b^2*d)*Log[a + b*Tan[e + f*x]])/(b^2*(a^2 + b^2)^2*f) - ((b*c - a*d)^2*(c + d*Tan[e + f*x]))/(b
*(a^2 + b^2)*f*(a + b*Tan[e + f*x]))

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3646

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b*c - a*d)^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - D
ist[1/(d*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a^2*d*(b*d*(
m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c*(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3
*a*b^2*d)*Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*(n + 1)))*Tan[e + f*x]^2, x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && Gt
Q[m, 2] && LtQ[n, -1] && IntegerQ[2*m]

Rule 3698

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 3707

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rubi steps

\begin {align*} \int \frac {(c+d \tan (e+f x))^3}{(a+b \tan (e+f x))^2} \, dx &=-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\int \frac {3 b^2 c^2 d+a^2 d^3+a b c \left (c^2-3 d^2\right )+b \left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \tan (e+f x)+\left (a^2+b^2\right ) d^3 \tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )}\\ &=-\frac {\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (a^2+b^2\right )^2}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\left ((b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right )\right ) \int \frac {1+\tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )^2}-\frac {\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \int \tan (e+f x) \, dx}{\left (a^2+b^2\right )^2}\\ &=-\frac {\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\left ((b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right )\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (e+f x)\right )}{b^2 \left (a^2+b^2\right )^2 f}\\ &=-\frac {\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}+\frac {(b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )^2 f}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 4.62, size = 535, normalized size = 2.33 \begin {gather*} \frac {\cos (e+f x) (a \cos (e+f x)+b \sin (e+f x)) \left (a^2 \cos (e+f x) \left (2 (a+i b)^2 \left (i a^2 d^3+2 a b d^3+b^2 c \left (c^2-3 i c d-3 d^2\right )\right ) (e+f x)-2 \left (a^2+b^2\right )^2 d^3 \log (\cos (e+f x))+(b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right ) \log \left ((a \cos (e+f x)+b \sin (e+f x))^2\right )\right )+b \left (2 (a+i b) \left (-i b^4 c^3+i a^4 d^3 (i+e+f x)+a^3 b d^2 (3 c+d (i+e+f x))+a b^3 c \left (c^2 (1+i e+i f x)-3 i d^2 (e+f x)+3 c d (i+e+f x)\right )+a^2 b^2 \left (c^3 (e+f x)+2 i d^3 (e+f x)-3 i c^2 d (-i+e+f x)-3 c d^2 (i+e+f x)\right )\right )-2 a \left (a^2+b^2\right )^2 d^3 \log (\cos (e+f x))+a (b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right ) \log \left ((a \cos (e+f x)+b \sin (e+f x))^2\right )\right ) \sin (e+f x)-2 i a (b c-a d)^2 \left (2 a b c+a^2 d+3 b^2 d\right ) \text {ArcTan}(\tan (e+f x)) (a \cos (e+f x)+b \sin (e+f x))\right ) (c+d \tan (e+f x))^3}{2 a (a-i b)^2 (a+i b)^2 b^2 f (c \cos (e+f x)+d \sin (e+f x))^3 (a+b \tan (e+f x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Tan[e + f*x])^3/(a + b*Tan[e + f*x])^2,x]

[Out]

(Cos[e + f*x]*(a*Cos[e + f*x] + b*Sin[e + f*x])*(a^2*Cos[e + f*x]*(2*(a + I*b)^2*(I*a^2*d^3 + 2*a*b*d^3 + b^2*
c*(c^2 - (3*I)*c*d - 3*d^2))*(e + f*x) - 2*(a^2 + b^2)^2*d^3*Log[Cos[e + f*x]] + (b*c - a*d)^2*(2*a*b*c + a^2*
d + 3*b^2*d)*Log[(a*Cos[e + f*x] + b*Sin[e + f*x])^2]) + b*(2*(a + I*b)*((-I)*b^4*c^3 + I*a^4*d^3*(I + e + f*x
) + a^3*b*d^2*(3*c + d*(I + e + f*x)) + a*b^3*c*(c^2*(1 + I*e + I*f*x) - (3*I)*d^2*(e + f*x) + 3*c*d*(I + e +
f*x)) + a^2*b^2*(c^3*(e + f*x) + (2*I)*d^3*(e + f*x) - (3*I)*c^2*d*(-I + e + f*x) - 3*c*d^2*(I + e + f*x))) -
2*a*(a^2 + b^2)^2*d^3*Log[Cos[e + f*x]] + a*(b*c - a*d)^2*(2*a*b*c + a^2*d + 3*b^2*d)*Log[(a*Cos[e + f*x] + b*
Sin[e + f*x])^2])*Sin[e + f*x] - (2*I)*a*(b*c - a*d)^2*(2*a*b*c + a^2*d + 3*b^2*d)*ArcTan[Tan[e + f*x]]*(a*Cos
[e + f*x] + b*Sin[e + f*x]))*(c + d*Tan[e + f*x])^3)/(2*a*(a - I*b)^2*(a + I*b)^2*b^2*f*(c*Cos[e + f*x] + d*Si
n[e + f*x])^3*(a + b*Tan[e + f*x])^2)

________________________________________________________________________________________

Maple [A]
time = 0.30, size = 281, normalized size = 1.22 Too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^3/(a+b*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(1/(a^2+b^2)^2*(1/2*(3*a^2*c^2*d-a^2*d^3-2*a*b*c^3+6*a*b*c*d^2-3*b^2*c^2*d+b^2*d^3)*ln(1+tan(f*x+e)^2)+(a^
2*c^3-3*a^2*c*d^2+6*a*b*c^2*d-2*a*b*d^3-b^2*c^3+3*b^2*c*d^2)*arctan(tan(f*x+e)))-(-a^3*d^3+3*a^2*b*c*d^2-3*a*b
^2*c^2*d+b^3*c^3)/(a^2+b^2)/b^2/(a+b*tan(f*x+e))+(a^4*d^3-3*a^2*b^2*c^2*d+3*a^2*b^2*d^3+2*a*b^3*c^3-6*a*b^3*c*
d^2+3*b^4*c^2*d)/(a^2+b^2)^2/b^2*ln(a+b*tan(f*x+e)))

________________________________________________________________________________________

Maxima [A]
time = 0.60, size = 312, normalized size = 1.36 \begin {gather*} \frac {\frac {2 \, {\left (6 \, a b c^{2} d - 2 \, a b d^{3} + {\left (a^{2} - b^{2}\right )} c^{3} - 3 \, {\left (a^{2} - b^{2}\right )} c d^{2}\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (2 \, a b^{3} c^{3} - 6 \, a b^{3} c d^{2} - 3 \, {\left (a^{2} b^{2} - b^{4}\right )} c^{2} d + {\left (a^{4} + 3 \, a^{2} b^{2}\right )} d^{3}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}} - \frac {{\left (2 \, a b c^{3} - 6 \, a b c d^{2} - 3 \, {\left (a^{2} - b^{2}\right )} c^{2} d + {\left (a^{2} - b^{2}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )}}{a^{3} b^{2} + a b^{4} + {\left (a^{2} b^{3} + b^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+b*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/2*(2*(6*a*b*c^2*d - 2*a*b*d^3 + (a^2 - b^2)*c^3 - 3*(a^2 - b^2)*c*d^2)*(f*x + e)/(a^4 + 2*a^2*b^2 + b^4) + 2
*(2*a*b^3*c^3 - 6*a*b^3*c*d^2 - 3*(a^2*b^2 - b^4)*c^2*d + (a^4 + 3*a^2*b^2)*d^3)*log(b*tan(f*x + e) + a)/(a^4*
b^2 + 2*a^2*b^4 + b^6) - (2*a*b*c^3 - 6*a*b*c*d^2 - 3*(a^2 - b^2)*c^2*d + (a^2 - b^2)*d^3)*log(tan(f*x + e)^2
+ 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)/(a^3*b^2 + a*b^4 + (a^2*b
^3 + b^5)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 509 vs. \(2 (234) = 468\).
time = 1.41, size = 509, normalized size = 2.21 \begin {gather*} -\frac {2 \, b^{5} c^{3} - 6 \, a b^{4} c^{2} d + 6 \, a^{2} b^{3} c d^{2} - 2 \, a^{3} b^{2} d^{3} - 2 \, {\left (6 \, a^{2} b^{3} c^{2} d - 2 \, a^{2} b^{3} d^{3} + {\left (a^{3} b^{2} - a b^{4}\right )} c^{3} - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} c d^{2}\right )} f x - {\left (2 \, a^{2} b^{3} c^{3} - 6 \, a^{2} b^{3} c d^{2} - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} c^{2} d + {\left (a^{5} + 3 \, a^{3} b^{2}\right )} d^{3} + {\left (2 \, a b^{4} c^{3} - 6 \, a b^{4} c d^{2} - 3 \, {\left (a^{2} b^{3} - b^{5}\right )} c^{2} d + {\left (a^{4} b + 3 \, a^{2} b^{3}\right )} d^{3}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + {\left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d^{3} \tan \left (f x + e\right ) + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (a b^{4} c^{3} - 3 \, a^{2} b^{3} c^{2} d + 3 \, a^{3} b^{2} c d^{2} - a^{4} b d^{3} + {\left (6 \, a b^{4} c^{2} d - 2 \, a b^{4} d^{3} + {\left (a^{2} b^{3} - b^{5}\right )} c^{3} - 3 \, {\left (a^{2} b^{3} - b^{5}\right )} c d^{2}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} f \tan \left (f x + e\right ) + {\left (a^{5} b^{2} + 2 \, a^{3} b^{4} + a b^{6}\right )} f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+b*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/2*(2*b^5*c^3 - 6*a*b^4*c^2*d + 6*a^2*b^3*c*d^2 - 2*a^3*b^2*d^3 - 2*(6*a^2*b^3*c^2*d - 2*a^2*b^3*d^3 + (a^3*
b^2 - a*b^4)*c^3 - 3*(a^3*b^2 - a*b^4)*c*d^2)*f*x - (2*a^2*b^3*c^3 - 6*a^2*b^3*c*d^2 - 3*(a^3*b^2 - a*b^4)*c^2
*d + (a^5 + 3*a^3*b^2)*d^3 + (2*a*b^4*c^3 - 6*a*b^4*c*d^2 - 3*(a^2*b^3 - b^5)*c^2*d + (a^4*b + 3*a^2*b^3)*d^3)
*tan(f*x + e))*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)/(tan(f*x + e)^2 + 1)) + ((a^4*b + 2*a^2*b^3
 + b^5)*d^3*tan(f*x + e) + (a^5 + 2*a^3*b^2 + a*b^4)*d^3)*log(1/(tan(f*x + e)^2 + 1)) - 2*(a*b^4*c^3 - 3*a^2*b
^3*c^2*d + 3*a^3*b^2*c*d^2 - a^4*b*d^3 + (6*a*b^4*c^2*d - 2*a*b^4*d^3 + (a^2*b^3 - b^5)*c^3 - 3*(a^2*b^3 - b^5
)*c*d^2)*f*x)*tan(f*x + e))/((a^4*b^3 + 2*a^2*b^5 + b^7)*f*tan(f*x + e) + (a^5*b^2 + 2*a^3*b^4 + a*b^6)*f)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 1.38, size = 6730, normalized size = 29.26 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**3/(a+b*tan(f*x+e))**2,x)

[Out]

Piecewise((zoo*x*(c + d*tan(e))**3/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((c**3*x + 3*c**2*d*log(tan(e +
 f*x)**2 + 1)/(2*f) - 3*c*d**2*x + 3*c*d**2*tan(e + f*x)/f - d**3*log(tan(e + f*x)**2 + 1)/(2*f) + d**3*tan(e
+ f*x)**2/(2*f))/a**2, Eq(b, 0)), (-c**3*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + 2*I*c**3*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + c
**3*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - c**3*tan(e + f*x)/(4*b**2*f*tan(e +
f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*c**3/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) -
 4*b**2*f) + 3*I*c**2*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) +
6*c**2*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*I*c**2*d*f*x/(4*
b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*c**2*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)*
*2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*c*d**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f
*tan(e + f*x) - 4*b**2*f) - 6*I*c*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) -
4*b**2*f) - 3*c*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 9*c*d**2*tan(e + f*
x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*I*c*d**2/(4*b**2*f*tan(e + f*x)**2 - 8*
I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*d**3*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) + 6*d**3*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) -
 3*I*d**3*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*d**3*log(tan(e + f*x)**2 + 1
)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*I*d**3*log(tan(e + f*x)*
*2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*d**3*log(tan(e + f*x)
**2 + 1)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 5*I*d**3*tan(e + f*x)/(4*b**2*f*tan
(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*d**3/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x
) - 4*b**2*f), Eq(a, -I*b)), (-c**3*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) -
4*b**2*f) - 2*I*c**3*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + c**3*f
*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - c**3*tan(e + f*x)/(4*b**2*f*tan(e + f*x)*
*2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*c**3/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b*
*2*f) - 3*I*c**2*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*c**
2*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*c**2*d*f*x/(4*b**2*
f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*I*c**2*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 +
8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*c*d**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(
e + f*x) - 4*b**2*f) + 6*I*c*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**
2*f) - 3*c*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 9*c*d**2*tan(e + f*x)/(4
*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 6*I*c*d**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**
2*f*tan(e + f*x) - 4*b**2*f) - 3*I*d**3*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x
) - 4*b**2*f) + 6*d**3*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*
d**3*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*d**3*log(tan(e + f*x)**2 + 1)*tan
(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 4*I*d**3*log(tan(e + f*x)**2 +
1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*d**3*log(tan(e + f*x)**2 +
 1)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 5*I*d**3*tan(e + f*x)/(4*b**2*f*tan(e +
f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*d**3/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4
*b**2*f), Eq(a, I*b)), (x*(c + d*tan(e))**3/(a + b*tan(e))**2, Eq(f, 0)), (2*a**5*d**3*log(a/b + tan(e + f*x))
/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**
7*f*tan(e + f*x)) + 2*a**5*d**3/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*ta
n(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 6*a**4*b*c*d**2/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x)
 + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*a**4*b*d**3*log(a/b +
tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e +
 f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*a**3*b**2*c**3*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x)
 + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) +...

________________________________________________________________________________________

Giac [A]
time = 0.79, size = 448, normalized size = 1.95 \begin {gather*} \frac {\frac {2 \, {\left (a^{2} c^{3} - b^{2} c^{3} + 6 \, a b c^{2} d - 3 \, a^{2} c d^{2} + 3 \, b^{2} c d^{2} - 2 \, a b d^{3}\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {{\left (2 \, a b c^{3} - 3 \, a^{2} c^{2} d + 3 \, b^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} - b^{2} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (2 \, a b^{3} c^{3} - 3 \, a^{2} b^{2} c^{2} d + 3 \, b^{4} c^{2} d - 6 \, a b^{3} c d^{2} + a^{4} d^{3} + 3 \, a^{2} b^{2} d^{3}\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}} - \frac {2 \, {\left (2 \, a b^{3} c^{3} \tan \left (f x + e\right ) - 3 \, a^{2} b^{2} c^{2} d \tan \left (f x + e\right ) + 3 \, b^{4} c^{2} d \tan \left (f x + e\right ) - 6 \, a b^{3} c d^{2} \tan \left (f x + e\right ) + a^{4} d^{3} \tan \left (f x + e\right ) + 3 \, a^{2} b^{2} d^{3} \tan \left (f x + e\right ) + 3 \, a^{2} b^{2} c^{3} + b^{4} c^{3} - 6 \, a^{3} b c^{2} d + 3 \, a^{4} c d^{2} - 3 \, a^{2} b^{2} c d^{2} + 2 \, a^{3} b d^{3}\right )}}{{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} {\left (b \tan \left (f x + e\right ) + a\right )}}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+b*tan(f*x+e))^2,x, algorithm="giac")

[Out]

1/2*(2*(a^2*c^3 - b^2*c^3 + 6*a*b*c^2*d - 3*a^2*c*d^2 + 3*b^2*c*d^2 - 2*a*b*d^3)*(f*x + e)/(a^4 + 2*a^2*b^2 +
b^4) - (2*a*b*c^3 - 3*a^2*c^2*d + 3*b^2*c^2*d - 6*a*b*c*d^2 + a^2*d^3 - b^2*d^3)*log(tan(f*x + e)^2 + 1)/(a^4
+ 2*a^2*b^2 + b^4) + 2*(2*a*b^3*c^3 - 3*a^2*b^2*c^2*d + 3*b^4*c^2*d - 6*a*b^3*c*d^2 + a^4*d^3 + 3*a^2*b^2*d^3)
*log(abs(b*tan(f*x + e) + a))/(a^4*b^2 + 2*a^2*b^4 + b^6) - 2*(2*a*b^3*c^3*tan(f*x + e) - 3*a^2*b^2*c^2*d*tan(
f*x + e) + 3*b^4*c^2*d*tan(f*x + e) - 6*a*b^3*c*d^2*tan(f*x + e) + a^4*d^3*tan(f*x + e) + 3*a^2*b^2*d^3*tan(f*
x + e) + 3*a^2*b^2*c^3 + b^4*c^3 - 6*a^3*b*c^2*d + 3*a^4*c*d^2 - 3*a^2*b^2*c*d^2 + 2*a^3*b*d^3)/((a^4*b + 2*a^
2*b^3 + b^5)*(b*tan(f*x + e) + a)))/f

________________________________________________________________________________________

Mupad [B]
time = 7.82, size = 271, normalized size = 1.18 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-c^3-c^2\,d\,3{}\mathrm {i}+3\,c\,d^2+d^3\,1{}\mathrm {i}\right )}{2\,f\,\left (-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )}{2\,f\,\left (-a^2+a\,b\,2{}\mathrm {i}+b^2\right )}+\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (b^2\,\left (3\,a^2\,d^3-3\,a^2\,c^2\,d\right )+a^4\,d^3+b^3\,\left (2\,a\,c^3-6\,a\,c\,d^2\right )+3\,b^4\,c^2\,d\right )}{f\,\left (a^4\,b^2+2\,a^2\,b^4+b^6\right )}+\frac {a^3\,d^3-3\,a^2\,b\,c\,d^2+3\,a\,b^2\,c^2\,d-b^3\,c^3}{b^2\,f\,\left (a^2+b^2\right )\,\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*tan(e + f*x))^3/(a + b*tan(e + f*x))^2,x)

[Out]

(log(tan(e + f*x) - 1i)*(3*c*d^2 - c^2*d*3i - c^3 + d^3*1i))/(2*f*(2*a*b - a^2*1i + b^2*1i)) + (log(tan(e + f*
x) + 1i)*(c*d^2*3i - 3*c^2*d - c^3*1i + d^3))/(2*f*(a*b*2i - a^2 + b^2)) + (log(a + b*tan(e + f*x))*(b^2*(3*a^
2*d^3 - 3*a^2*c^2*d) + a^4*d^3 + b^3*(2*a*c^3 - 6*a*c*d^2) + 3*b^4*c^2*d))/(f*(b^6 + 2*a^2*b^4 + a^4*b^2)) + (
a^3*d^3 - b^3*c^3 + 3*a*b^2*c^2*d - 3*a^2*b*c*d^2)/(b^2*f*(a^2 + b^2)*(a + b*tan(e + f*x)))

________________________________________________________________________________________